﻿/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __B5FC1D46_FB86_45aa_97A8_473F1E2B3419__
#define __B5FC1D46_FB86_45aa_97A8_473F1E2B3419__

namespace xos_log
{
    class config
    {
    public:
        config( i_log * pLog );
        ~config();

    protected:
        i_log * m_pLog;

    protected:
        int load_config_info( xos_xml::i_xml_node * pRoot );
        int load_log_modules( xos_xml::i_xml_node * pLog );
        int load_log_module( xos_xml::i_xml_node * pLog );
        int load_log_levels( const char * lpszModuleName, xos_xml::i_xml_node * pLevels );
        int load_log_level( const char * lpszModuleName, xos_xml::i_xml_node * pLevel );

    public:
        int load_config_string( const char * lpszConfigString );
        int load_config_file( const char * lpszConfigFile );
    };
} // xos_log

#endif // __B5FC1D46_FB86_45aa_97A8_473F1E2B3419__
